package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;

@TableName("t_forumUser")
public class UserBean {
    /**
     * 用户id
     */
    @TableId(value="pk_userId" , type= IdType.AUTO)
    private Integer id;
    /**
     * 用户名
     */
    @TableField("u_name")
    private String userName;
    /**
     * 密码
     */
    @TableField("u_pwd")
    private String pwd;
    /**
     * 邮箱
     */
    @TableField("u_email")
    private String email;

    /**
     * 头像
     */
    @TableField("u_imgPath")
    private String imgPath;
    /**
     * 注册日期
     */
    @TableField("u_regDate")
    private LocalDate regDate = LocalDate.now();

    public UserBean() {
    }

    public UserBean(String userName, String pwd, String email, String imgPath) {
        this.userName = userName;
        this.pwd = pwd;
        this.email = email;
        this.imgPath = imgPath;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getImgPath() {
        return imgPath;
    }

    public void setImgPath(String imgPath) {
        this.imgPath = imgPath;
    }

    public LocalDate getRegDate() {
        return regDate;
    }

    public void setRegDate(LocalDate regDate) {
        this.regDate = regDate;
    }

    @Override
    public String toString() {
        return "UserBean{" +
                "id=" + id +
                ", userName='" + userName + '\'' +
                ", pwd='" + pwd + '\'' +
                ", email='" + email + '\'' +
                ", imgPath='" + imgPath + '\'' +
                ", regDate=" + regDate +
                "}\n";
    }
}
